<#macro init_js>
<script type="text/javascript">
var _CssSrc_="";
</script>
</#macro>

<#macro attach_js src>
<script type="text/javascript">
(function(d) {
	var tag=d.createElement("script");
	tag.type="text/javascript";
	tag.async=true;
	tag.src=d.location.protocol+"//"+d.location.hostname+(""==d.location.port?"":":"+d.location.port)+"${rootUrl}/misc/getjs.html?src=${src}";
	d.getElementsByTagName("head")[0].appendChild(tag);
}
)(document);
</script>
</#macro>

<#--添加css src到变量_CssSrc_中-->
<#macro attach_css src>
<script type="text/javascript">
(function(d) {
	_CssSrc_+=",${src}";
}
)(document);
</script>
</#macro>

<#--将变量_CssSrc_中的所有css下载到本地-->
<#macro flush_css>
<script type="text/javascript">
(function(d) {
	if(_CssSrc_!=""){
		var tag=d.createElement("link");
		tag.type="text/css";
		tag.rel="stylesheet";
		tag.href=d.location.protocol+"//"+d.location.hostname+(""==d.location.port?"":":"+d.location.port)+"${rootUrl}/misc/getcss.html?src="+_CssSrc_;
		d.getElementsByTagName("head")[0].appendChild(tag);
		_CssSrc_="";
	}
}
)(document);
</script>
</#macro>